/*    */ package com.zimbra.cs.account.ldap.upgrade;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.account.Config;
/*    */ import com.zimbra.cs.account.Entry.EntryType;
/*    */ import com.zimbra.cs.account.ldap.LdapProv;
/*    */ import com.zimbra.cs.ldap.LdapClient;
/*    */ import com.zimbra.cs.ldap.LdapServerType;
/*    */ import com.zimbra.cs.ldap.LdapUsage;
/*    */ import com.zimbra.cs.ldap.ZLdapContext;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class BUG_68394
/*    */   extends UpgradeOp
/*    */ {
/*    */   private static final String ATTR_NAME = "zimbraMailSSLClientCertPort";
/*    */   private static final String OLD_VALUE = "0";
/*    */   private static final String NEW_VALUE = "9443";
/*    */   
/*    */   void doUpgrade()
/*    */     throws ServiceException
/*    */   {
/* 40 */     ZLdapContext zlc = LdapClient.getContext(LdapServerType.MASTER, LdapUsage.UPGRADE);
/*    */     try {
/* 42 */       doGlobalConfig(zlc);
/*    */     } finally {
/* 44 */       LdapClient.closeContext(zlc);
/*    */     }
/*    */   }
/*    */   
/*    */   Description getDescription()
/*    */   {
/* 50 */     return new Description(this, new String[] { "zimbraMailSSLClientCertPort" }, new Entry.EntryType[] { Entry.EntryType.GLOBALCONFIG }, "0", "9443", String.format("Upgrade attribute %s on global config from \"%s\" to \"%s\"", new Object[] { "zimbraMailSSLClientCertPort", "0", "9443" }));
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   private void doGlobalConfig(ZLdapContext zlc)
/*    */     throws ServiceException
/*    */   {
/* 60 */     Config config = this.prov.getConfig();
/* 61 */     String curValue = config.getAttr("zimbraMailSSLClientCertPort");
/* 62 */     if ("0".equals(curValue)) {
/* 63 */       Map<String, Object> attrs = new HashMap();
/* 64 */       attrs.put("zimbraMailSSLClientCertPort", "9443");
/* 65 */       modifyAttrs(config, attrs);
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/ldap/upgrade/BUG_68394.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */